// -----------------------------------------------------------------------
//  <copyright file="AspNetCoreOptions.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2024 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://www.dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2024-05-13 09:05</last-date>
// -----------------------------------------------------------------------

namespace DaprPlus.AspNetCore;

/// <summary>
/// AspNetCore选项
/// </summary>
public class AspNetCoreOptions
{
    public const string Position = "AspNetCore";

    private bool _isApiOnly = true;
    public bool IsApiOnly
    {
        get => _isApiOnly;
        set
        {
            _isApiOnly = value;
            if (value)
            {
                IsMvc = false;
                IsRazorPage = false;
            }
        }
    }

    private bool _isMvc;
    public bool IsMvc
    {
        get => _isMvc;
        set
        {
            _isMvc = value;
            if (value)
            {
                IsApiOnly = false;
                IsRazorPage = false;
            }
        }
    }

    private bool _isRazorPage;
    public bool IsRazorPage
    {
        get => _isRazorPage;
        set
        {
            _isRazorPage = value;
            if (value)
            {
                IsApiOnly = false;
                IsMvc = false;
            }
        }
    }

    public bool IsSignalR { get; set; }

    /// <summary>
    /// 获取或设置 是否URL小写，默认：false
    /// </summary>
    public bool IsLowercaseUrls { get; set; } = false;

    /// <summary>
    /// 获取或设置 Json属性小写，默认：true
    /// </summary>
    public bool IsLowercaseJsonProperty { get; set; } = true;

    /// <summary>
    /// 获取或设置 是否将Long类型转换为字符串，默认：true
    /// </summary>
    public bool IsLongToStringConvert { get; set; } = true;
}
